
var Gc = React.createClass({
	render : function(){
		return (
			 <div className="car_goods_list" data-id={this.props.data.id}>
			 	<img src={this.props.data.img}/>
			 	<section>
			 		<p>{this.props.data.conent}</p>
			 		<span>¥{this.props.data.price}</span>
			 	</section>
			 	<div className="car_ding">
			 		<aside onClick={this.jian}>-</aside>
					<aside>{this.props.data.num}</aside>
					<aside onClick={this.jia}>+</aside>
			 	</div>
			 	<div className="car_btn_l">√</div>
			 	<i className="iconfont shanicon icon-icon_delete"></i>
			 </div>
		)
	}
})








export default React.createClass({
	componentDidMount(){
		var ls=0
		this.props.list.map(function(value,index){
			ls+=value.num * value.price
		})
		$('.car_footer').find("b").html(ls)
	},
	render: function(){
		console.log(this.props.list)
		var obj = this.props.list.map(function(data,index){
			return <Gc data={data} key={index}/>
		})
		return(
			<div style={this.props.data}>
				<div className="car_top">
					<span className="car_dui">√</span>
					<i className="iconfont car_icon_top icon-dangao"></i>
					<p>茶窝网</p>
				</div>
				<div className="car_top_bom">
					<span>免运费</span>
					满99免运费
				</div>
				<div className="car_goods_zhong">
					{obj}
				</div>
				<div className="car_footer">
					<span className="car_zong_btn">√</span>
					<div>总计金额 :</div>
					<b></b>
					<button>立即结算</button>
				</div>
			</div>
		)
	}
})
